package com.xique.park.api.factory;

import com.xique.common.core.domain.R;
import com.xique.park.api.RemoteBillFileService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.cloud.openfeign.FallbackFactory;
import org.springframework.stereotype.Component;

/**
 * 结算对账单服务错误降级处理类
 *
 * @author WLD
 */
@Slf4j
@Component
public class RemoteBillFileServiceFallbackFactory implements FallbackFactory<RemoteBillFileService> {

    @Override
    public RemoteBillFileService create(Throwable cause) {
        log.error("结算对账单服务调用失败:{}", cause.getMessage());
        return () -> R.fail("结算对账单下载 / 清分对账单下载接口调用失败" + cause.getMessage());
    }

}
